<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
<meta http-equiv="Pragma" content="no-cache"> 
<meta http-equiv="Cache-Control" content="no-cache"> 
<meta http-equiv="Expires" content="0"> 
<title>海西州"互联网+"病虫害在线诊断平台后台管理系统</title>
<link th:href="@{/css/login2.css}" type="text/css" rel="stylesheet">
</head> 
<body>
	<div class="login">
		<div class="message">海西州"互联网+"病虫害在线诊断平台后台管理系统</div>
		<div id="darkbannerwrap"></div>
		<form method="post" id="form-user-login" onsubmit="return login()">
			<input name="username" id="username" placeholder="用户名" type="text" />
			<hr class="hr15" />
			<input name="password" id="password" placeholder="密码" type="password" />
			<hr class="hr15" />
			<input value="登录" style="width:100%;" type="submit"/>
			<hr class="hr20" />
		</form>
	</div>
<!--	<script type="text/javascript" th:src="@{/js/jquery-3.1.1.min.js}"></script>-->
<!--	<script type="text/javascript" th:src="@{/js/layer/layer.js}"></script>-->
<!--    <script type="text/javascript" th:src="@{/js/comm/gisData.js(v=${session.jscssVersion})}"></script>-->
<!--    <script type="text/javascript" th:src="@{/js/login.js(v=${session.jscssVersion})}"></script>-->
	<div th:include="admin/common/common_js :: onLoadJS"></div>
	<script>
		function login() {
			var account = $.trim($('#username').val());
			// alert(account);
			var password = $.trim($('#password').val());
			// var captcah = $.trim($('#captcha').val());
			if(account == "" || account == null) {
				// alert("123");
				layer.tips('账号不能为空', '#username');
				return false;
			} else if(password == "") {
				layer.tips('密码不能为空', '#password');
				return false;
			} else {
				$.ajax({
					url:'/pestdiagnosis/executeLogin',
					data:{"account":account,"password":password},
					type:"post",
					dataType:"json",
					cache:false,
					async:false,
					success:function(data){
						if(data.result == 0) {
							layer.msg(data.message);
							window.location.href = '/pestdiagnosis/main';
						} else {
							layer.msg(data.message, {icon: 5,time: 1500});
							$('#account').focus();
						}
					},error:function(){
						alert("发送失败");
					}
				});

			}
			return false;
		}
</script>
</body>
</html>